import React from "react";
import {
  createBrowserRouter,
  createHashRouter,
  RouterProvider,
} from "react-router-dom";
import Home from "../pages/home";
const Login = React.lazy(() => import("../pages/login"));
const Welcome = React.lazy(() => import("../pages/welcome.jsx"));
const NotFound = React.lazy(() => import("../pages/404"));
const Blog = React.lazy(() => import("../pages/blog"));
const User = React.lazy(() => import("../pages/user"));
const router = createBrowserRouter([
  {
    path: "/login",
    // element: <Login />,
    Component: Login,
  },
  {
    path: "/",
    element: <Home />,
    children: [
      {
        index: true,
        Component: Welcome,
      },
      {
        path: "/blog",
        Component: Blog,
      },
      {
        path: "/user",
        Component: User,
      },
      {
        path: "*",
        Component: NotFound,
      },
    ],
  },
  {
    path: "/404",
    Component: NotFound,
  },
]);
export default router;
